A database may be defined as a structured collection of records or data that is stored in a computer so that a program can consult it to answer queries. The records retrieved in answer to queries become information that may be used to make decisions. The computer program used to manage and query a database may be referred to as a database management system.
Typically, for a given database, there is a structural description of the type of facts held in the database. The structural description may be referred to as a “schema.” The schema describes the objects that are represented in the database, and the relationships among them. There are a number of different ways of organizing a schema, that is, of modeling the database structure. These are known as database models or data models. One such model is referred to as the “relational model.” The relational database model represents all information in the form of multiple related tables each consisting of rows and columns. The relational database model represents relationships by the use of values common to more than one table.
As discussed above, a database, such as a relational database, may include tables each consisting of rows and columns. One or more of these tables may be referred to as a “source table(s).” A source table refers to the table that includes the latest data populated by an external data source. For example, an application taking online orders may be populating the source table with order information (e.g., the product being purchased, the credit card number of the buyer, etc).
Further, one or more of the tables in the database, such as a relational database, may be referred to as a “target table(s).” A target table may refer to a table that serves as a back-up table to the source table. Hence, there is an effort in ensuring that the data in the target table is current and consistent with the data in the source table. The process in ensuring that the data in the target table is current and consistent with the data in the source table may be referred to as “synchronization.” Further, the target table may be said to store “archival data” where “archival data” may refer to data that is no longer necessary to be stored in the source table (archival data is to be deleted from the source table) but is still valuable for later use (e.g., analysis is performed on the archival data to determine marketing trends).
Synchronization may occur by having an application of the database management system reading a log which indicates the changes to the source data (data in the source table) and then mirroring those changes into the target table. Alternatively, synchronization may also occur by performing Structured Query Language (SQL) queries for retrieving the data in the entire source table and then updating the entire target table with the retrieved data.
However, when a row(s) of archival data is deleted from the source table during such synchronization methods, the archival data stored in the deleted rows may not have already been stored in the target table. That is, archival data may be deleted from the source table prior to being stored in the target table thereby preventing the target table from storing the archival data.
Therefore, there is a need in the art to ensure that the data deleted in the relational source table is already stored in the relational target table.